home *** CD-ROM | disk | FTP | other *** search
/ Totally AMOS / Totally AMOS - Issue 1 (1991-11)(Tucker, Len - Tucker, Anne).adf / source_progs / alert_box.amos / alert_box.amosSourceCode
AMOS Source Code  |  1991-09-22  |  2KB  |  53 lines

  1. '********uses 10 lines of text & 2 clickable buttons 
  2. WARN["Feel Free To Use| |This Routine In Your| |Own Programs","OK"]
  3. WARN["Routine originally|written by Arron|Fothergill Converted By|L. Tucker.","OK"]
  4. WARN["The variable Q Holds| |either '1' or '2' this| |tells you which button| |the user has pressed| |try it now.","Left|Right"]
  5. Q=Param
  6. If Q=1 Then Print "You pressed the left button."
  7. If Q=2 Then Print "You pressed the right button."
  8. Print : Print "Good little routine isn't it!!"
  9. Procedure WARN[M$,B$]
  10.    Dim M$(10),B$(2)
  11.    L=0 : I=0 : IO=0 : While I<Len(M$)
  12. I=Instr(M$,"|",I+1)
  13.       If I=0 Then I=Len(M$)+1
  14.       M$(L)=Mid$(M$,IO+1,I-IO-1) : IO=I : Inc L : Wend 
  15.    B=0 : I=0 : IO=0 : While I<Len(B$)
  16.       I=Instr(B$,"|",I+1)
  17.       If I=0 Then I=Len(B$)+1
  18.       B$(B)=Mid$(B$,IO+1,I-IO-1) : IO=I : Inc B : Wend 
  19.    Auto View On : Screen Open 5,320,L*8+32,4,Lowres : Curs Off : Flash Off 
  20. '******the line below will allow you to change the 4 colours used to suit
  21. '******your own needs. 
  22. Colour 0,$0 : Colour 1,$333 : Colour 2,$888 : Colour 3,$FFF
  23.    Screen Display 5,,78-NTS*32-L*4,,L*8+32 : Screen To Front 5 : Cls 0 : Gr Writing 0
  24.    Ink 2,2 : Bar 64,0 To 256,L*8+31 : Ink 1 : Box 65,1 To 255,L*8+30 : Ink 3 : Draw 66,L*8+30 To 255,L*8+30 : Draw To 255,1
  25.    For A=0 To L-1
  26. Ink 0 : Text 160-Len(M$(A))*4,A*8+12,M$(A) : Ink 3 : Text 159-Len(M$(A))*4,A*8+11,M$(A)
  27. Next A
  28.    D2=160-(Len(B$)+B*2)*4 : D=((Len(B$)+B*2)*10)/B : Reserve Zone B
  29.    For A=0 To B-1
  30. If A=0 : SHX=-16 : Else SHX=0 : End If 
  31. If B=1 : SHX=0 : End If 
  32.       Ink 3 : Box SHX+D2+D*A,L*8+16 To SHX+D2+20+D*A+Len(B$(A))*8,L*8+28
  33. Ink 1 : Draw SHX+D2+D*A,L*8+28 To SHX+D2+20+D*A+Len(B$(A))*8,L*8+28 : Draw To SHX+D2+20+D*A+Len(B$(A))*8,L*8+16
  34.       Set Zone A+1,SHX+D2+D*A,L*8+16 To SHX+D2+20+D*A+Len(B$(A))*8,L*8+28 : Ink 0 : Text SHX+D2+10+D*A,L*8+25,B$(A)
  35. Ink 3 : Text SHX+D2+9+D*A,L*8+24,B$(A)
  36.    Next A
  37. Q=0
  38. Repeat 
  39. If Mouse Key=1 and Mouse Zone>0
  40. Q=Mouse Zone : Bell 
  41.    For A=0 To B-1
  42. If A=0 : SHX=-16 : Else SHX=0 : End If 
  43. If B=1 : SHX=0 : End If 
  44. If A=Q-1
  45.       Ink 1 : Box SHX+D2+D*A,L*8+16 To SHX+D2+20+D*A+Len(B$(A))*8,L*8+28
  46. Ink 3 : Draw SHX+D2+D*A,L*8+28 To SHX+D2+20+D*A+Len(B$(A))*8,L*8+28 : Draw To SHX+D2+20+D*A+Len(B$(A))*8,L*8+16
  47. End If 
  48.    Next A
  49. End If 
  50. Until Q>0
  51. While Mouse Key<>0 : Wend 
  52.    Reset Zone : Screen Close 5 : Z=Free+Chip Free+Fast Free
  53. End Proc[Q]